#include<iostream>
#include"./dynamic_lib/hthread_sub.h"

int main() {
    std::cout << "This is a test for dynamic library!" << std::endl;
    hthread_dev_open(0);
    hthread_dat_load(0, (char *)"../huibian.txt");
    std::cout << "dat load success!" << std::endl;
    int thread_id = hthread_group_create(0, 4, (char *)"try2", 0, 0, nullptr);
    std::cout << "Created thread group with id: " << thread_id << std::endl;
    // Simulate doing other work here...
    // Now wait for the thread group to finish
    hthread_group_wait(thread_id);
    std::cout << "Thread group " << thread_id << " has finished execution." << std::endl;
    hthread_group_destroy(thread_id);   
    hthread_dat_unload(0);
    hthread_dev_close(0);
    return 0;
}

